home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Plus 1995 #1
/
Amiga Plus 1995 #1.iso
/
fish-disketten
/
fish_691-700
/
d695
/
icalc
/
scripts
/
arraytest.ic
< prev
next >
Wrap
Text File
|
1994-12-13
|
691b
|
34 lines
# tests out arrays in general, and routines in array.ic in particular
read "array.ic" # doesn't hurt to re-read it...
silent # doesn't affect echo or display
array ta1[5] = {1,2,3,4,5}; # test array 1
array ta2[5] # test array 2
echo "\nShould be 1 .. 5"
display(ta1)
echo "\nShould be 1! .. 5!"
map(ta1,fact(x)) # ta1[i] = ta1[i]!
display(ta1)
echo "\nShould be 1² .. 5²"
fill(ta2, n*n) # fill it with first 5 squares
display(ta2)
echo "\nShould be 1² .. 5²"
copy(ta1, ta2) # ta1[i] = ta2[i]
display(ta1)
echo "\nShould be 1 .. 5, then 1^3 .. 5^3"
tabulate(ta1,ta2,1,5,x^3)
display(ta1)
echo
display(ta2)
echo "\nThat's all folks!"
verbose # results/prompt back on